﻿
/***************************************************
 * File name: WSCeCommerceWeb.cs 
 * Author: Team A
 * Change Log: Please see SVN repository: http://test-project-drew1.googlecode.com/svn/trunk/
 * Date: December 2013
 * Description: Common Java script functions 
 * *************************************************/


//Add an item to the shopping cart
function AddToCart(id) {
     $.ajax({
        type: "POST",
        url: "/ShoppingCart/AddToCart",
        data: { id: id },
        success: function (returndata) {
            if (returndata.ok) {
                window.alert(returndata.message);

                $("#mnuShoppingCart").show();
                $("#mnuCheckOut").show();

                return returndata.count;
            }
            else {
                window.alert(' error : ' + returndata.message);
            }

        }
    }
   );
}